package com.yys.excel.yysexcel.common.constant;

/**
 * @author rain
 * @description Spring Security相关配置常量
 */
public final class SecurityConstants {

    /**
     * 角色的key
     **/
    public static final String ROLE_CLAIMS = "rol";

    /**
     * rememberMe 为 false 的时候过期时间是1个小时
     */
    public static final long EXPIRATION = 2 * 60 * 60L;

    /**
     * rememberMe 为 true 的时候过期时间是7天
     */
    public static final long EXPIRATION_REMEMBER = 60 * 60 * 24 * 7L;

    /**
     * url允许的特殊字符
     */
    public static final String relaxedUrlChars = "|{}[],";

    /**
     * JWT签名密钥硬编码到应用程序代码中，应该存放在环境变量或.properties文件中。
     */
    public static final String JWT_SECRET_KEY = "C*F-JaNdRgUkXn2r5u8x/A?D(G+KbPeShVmYq3s6v9y$B&E)H@McQfTjWnZr4u7w";

    // JWT token defaults
    public static final String TOKEN_HEADER = "Authorization";
    public static final String TOKEN_PREFIX = "Bearer ";
    public static final String TOKEN_TYPE = "JWT";
    public static final String USER_LOGIN = "nmcf_major:";
    public static final String USER_APP_LOGIN = "pump_app_login:";

    // Swagger WHITELIST
    public static final String[] SWAGGER_WHITELIST = {
            "/swagger-ui.html",
            "/swagger-ui/*",
            "/swagger-resources/**",
            "/v2/api-docs",
            "/v3/api-docs",
            "/webjars/**",
            "/doc.html",
            "/actuator/**",
            "/**/export",
            "/**/importTemplate",
            "/api/loginReturnToken",
            "/api/**/getDataById"
    };

    public static final String[] GET = {
            "/login",
    };


    public static final String[] POST = {
            "/user/login", "/loginToken","/loginReturnToken"
    
    };
    public static  String[] STATIC = {
            "/css/**", "/error/**", "/fonts/**", "/images/**", "/js/**", "/lib/**", "/pages/**", "/static/**"
    };
    
    private SecurityConstants() {
    }

}
